import { createApp } from "vue";
import { createPinia } from "pinia";
import persistedstate from "pinia-plugin-persistedstate";

// 引入 vant 组件
import {
  Button,
  Tabbar,
  TabbarItem,
  Swipe,
  SwipeItem,
  Toast,
  Grid,
  GridItem,
  CountDown,
  NavBar,
  Icon,
  Popover,
  Popup,
  SubmitBar,
  ActionBar,
  ActionBarIcon,
  ActionBarButton,
  Form,
  Field,
  CellGroup,
  Dialog,
  Notify,
  SwipeCell,
  Card,
  Checkbox,
  Stepper,
} from "vant";
// 引入 vant 样式
import "vant/lib/index.css";

import App from "./App.vue";
import router from "./router";

import "normalize.css";

const app = createApp(App);
const pinia = createPinia();

// 注册pinia的持久化插件
pinia.use(persistedstate);

app.use(pinia);
app.use(router);

// 注册 vant 组件
app
  .use(Button)
  .use(Tabbar)
  .use(TabbarItem)
  .use(Swipe)
  .use(SwipeItem)
  .use(Toast)
  .use(Grid)
  .use(GridItem)
  .use(CountDown)
  .use(NavBar)
  .use(Icon)
  .use(Popover)
  .use(Popup)
  .use(SubmitBar)
  .use(ActionBar)
  .use(ActionBarIcon)
  .use(ActionBarButton)
  .use(Form)
  .use(Field)
  .use(CellGroup)
  .use(Dialog)
  .use(Notify)
  .use(SwipeCell)
  .use(Card)
  .use(Checkbox)
  .use(Stepper);

app.mount("#app");
